﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;

namespace Admin.NET.Application;

/// <summary>
/// 系统入库单表基础输入参数
/// </summary>
public class SysinstockorderBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 入库单号
    /// </summary>
    [Required(ErrorMessage = "入库单号不能为空")]
    public virtual string Code { get; set; }
    
    /// <summary>
    /// 入库类型
    /// </summary>
    public virtual string? InType { get; set; }
    
    /// <summary>
    /// 单据状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue=true)]
    [Required(ErrorMessage = "单据状态不能为空")]
    public virtual DocumentStatusEnum? DocumentStatus { get; set; }
    
    /// <summary>
    /// 入库日期
    /// </summary>
    [Required(ErrorMessage = "入库日期不能为空")]
    public virtual DateTime InDate { get; set; }
    
    /// <summary>
    /// 仓库名称
    /// </summary>
    public virtual string? WarehouseName { get; set; }
    
    /// <summary>
    /// 关联单号
    /// </summary>
    public virtual string? RelatedCode { get; set; }
    
    /// <summary>
    /// 入库货品
    /// </summary>
    public virtual string? GoodsName { get; set; }
    
    /// <summary>
    /// 经办人
    /// </summary>
    public virtual string? AgentName { get; set; }
    
    /// <summary>
    /// 入库数量
    /// </summary>
    [Required(ErrorMessage = "入库数量不能为空")]
    public virtual int? InQuantity { get; set; }
    
    /// <summary>
    /// 入库金额
    /// </summary>
    public virtual decimal? WarehouseAmount { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Remark { get; set; }
    
    /// <summary>
    /// 软删除时间
    /// </summary>
    public virtual DateTime? DeleteTime { get; set; }
    
}

/// <summary>
/// 系统入库单表分页查询输入参数
/// </summary>
public class PageSysinstockorderInput : BasePageInput
{
    /// <summary>
    /// 入库单号
    /// </summary>
    public string Code { get; set; }
    
    /// <summary>
    /// 入库类型
    /// </summary>
    public string? InType { get; set; }
    
    /// <summary>
    /// 单据状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue=true)]
    public DocumentStatusEnum? DocumentStatus { get; set; }
    
    /// <summary>
    /// 入库日期范围
    /// </summary>
     public DateTime?[] InDateRange { get; set; }
    
    /// <summary>
    /// 仓库名称
    /// </summary>
    public string? WarehouseName { get; set; }
    
    /// <summary>
    /// 关联单号
    /// </summary>
    public string? RelatedCode { get; set; }
    
    /// <summary>
    /// 入库货品
    /// </summary>
    public string? GoodsName { get; set; }
    
    /// <summary>
    /// 经办人
    /// </summary>
    public string? AgentName { get; set; }
    
    /// <summary>
    /// 入库数量
    /// </summary>
    public int? InQuantity { get; set; }
    
    /// <summary>
    /// 入库金额
    /// </summary>
    public decimal? WarehouseAmount { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }
    
    /// <summary>
    /// 软删除时间范围
    /// </summary>
     public DateTime?[] DeleteTimeRange { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 系统入库单表增加输入参数
/// </summary>
public class AddSysinstockorderInput
{
    /// <summary>
    /// 入库单号
    /// </summary>
    [Required(ErrorMessage = "入库单号不能为空")]
    [MaxLength(64, ErrorMessage = "入库单号字符长度不能超过64")]
    public string Code { get; set; }
    
    /// <summary>
    /// 入库类型
    /// </summary>
    [MaxLength(32, ErrorMessage = "入库类型字符长度不能超过32")]
    public string? InType { get; set; }
    
    /// <summary>
    /// 单据状态
    /// </summary>
    [Dict(nameof(DocumentStatusEnum), AllowNullValue=true)]
    [Required(ErrorMessage = "单据状态不能为空")]
    public DocumentStatusEnum? DocumentStatus { get; set; }
    
    /// <summary>
    /// 入库日期
    /// </summary>
    [Required(ErrorMessage = "入库日期不能为空")]
    public DateTime InDate { get; set; }
    
    /// <summary>
    /// 仓库名称
    /// </summary>
    [MaxLength(64, ErrorMessage = "仓库名称字符长度不能超过64")]
    public string? WarehouseName { get; set; }
    
    /// <summary>
    /// 关联单号
    /// </summary>
    [MaxLength(64, ErrorMessage = "关联单号字符长度不能超过64")]
    public string? RelatedCode { get; set; }
    
    /// <summary>
    /// 入库货品
    /// </summary>
    [MaxLength(512, ErrorMessage = "入库货品字符长度不能超过512")]
    public string? GoodsName { get; set; }
    
    /// <summary>
    /// 经办人
    /// </summary>
    [MaxLength(64, ErrorMessage = "经办人字符长度不能超过64")]
    public string? AgentName { get; set; }
    
    /// <summary>
    /// 入库数量
    /// </summary>
    [Required(ErrorMessage = "入库数量不能为空")]
    public int? InQuantity { get; set; }
    
    /// <summary>
    /// 入库金额
    /// </summary>
    public decimal? WarehouseAmount { get; set; }
    
    /// <summary>
    /// 库位ID
    /// </summary>
    public long? WarePlaceId { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(512, ErrorMessage = "备注字符长度不能超过512")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 软删除时间
    /// </summary>
    public DateTime? DeleteTime { get; set; }
    
}

/// <summary>
/// 系统入库单表删除输入参数
/// </summary>
public class DeleteSysinstockorderInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 系统入库单表更新输入参数
/// </summary>
public class UpdateSysinstockorderInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 入库单号
    /// </summary>    
    [Required(ErrorMessage = "入库单号不能为空")]
    [MaxLength(64, ErrorMessage = "入库单号字符长度不能超过64")]
    public string Code { get; set; }
    
    /// <summary>
    /// 入库类型
    /// </summary>    
    [MaxLength(32, ErrorMessage = "入库类型字符长度不能超过32")]
    public string? InType { get; set; }
    
    /// <summary>
    /// 单据状态
    /// </summary>    
    [Dict(nameof(DocumentStatusEnum), AllowNullValue=true)]
    [Required(ErrorMessage = "单据状态不能为空")]
    public DocumentStatusEnum? DocumentStatus { get; set; }
    
    /// <summary>
    /// 入库日期
    /// </summary>    
    [Required(ErrorMessage = "入库日期不能为空")]
    public DateTime InDate { get; set; }
    
    /// <summary>
    /// 仓库名称
    /// </summary>    
    [MaxLength(64, ErrorMessage = "仓库名称字符长度不能超过64")]
    public string? WarehouseName { get; set; }
    
    /// <summary>
    /// 关联单号
    /// </summary>    
    [MaxLength(64, ErrorMessage = "关联单号字符长度不能超过64")]
    public string? RelatedCode { get; set; }
    
    /// <summary>
    /// 入库货品
    /// </summary>    
    [MaxLength(512, ErrorMessage = "入库货品字符长度不能超过512")]
    public string? GoodsName { get; set; }
    
    /// <summary>
    /// 经办人
    /// </summary>    
    [MaxLength(64, ErrorMessage = "经办人字符长度不能超过64")]
    public string? AgentName { get; set; }
    
    /// <summary>
    /// 入库数量
    /// </summary>    
    [Required(ErrorMessage = "入库数量不能为空")]
    public int? InQuantity { get; set; }
    
    /// <summary>
    /// 入库金额
    /// </summary>    
    public decimal? WarehouseAmount { get; set; }
    
    /// <summary>
    /// 库位ID
    /// </summary>
    public long? WarePlaceId { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>    
    [MaxLength(512, ErrorMessage = "备注字符长度不能超过512")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 软删除时间
    /// </summary>    
    public DateTime? DeleteTime { get; set; }
    
}

/// <summary>
/// 系统入库单表主键查询输入参数
/// </summary>
public class QueryByIdSysinstockorderInput : DeleteSysinstockorderInput
{
}

/// <summary>
/// 系统入库单表数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportSysinstockorderInput : BaseImportInput
{
    /// <summary>
    /// 入库单号
    /// </summary>
    [ImporterHeader(Name = "*入库单号")]
    [ExporterHeader("*入库单号", Format = "", Width = 25, IsBold = true)]
    public string Code { get; set; }
    
    /// <summary>
    /// 入库类型
    /// </summary>
    [ImporterHeader(Name = "入库类型")]
    [ExporterHeader("入库类型", Format = "", Width = 25, IsBold = true)]
    public string? InType { get; set; }
    
    /// <summary>
    /// 单据状态
    /// </summary>
    [ImporterHeader(Name = "*单据状态")]
    [ExporterHeader("*单据状态", Format = "", Width = 25, IsBold = true)]
    public DocumentStatusEnum? DocumentStatus { get; set; }
    
    /// <summary>
    /// 入库日期
    /// </summary>
    [ImporterHeader(Name = "*入库日期")]
    [ExporterHeader("*入库日期", Format = "", Width = 25, IsBold = true)]
    public DateTime InDate { get; set; }
    
    /// <summary>
    /// 仓库名称
    /// </summary>
    [ImporterHeader(Name = "仓库名称")]
    [ExporterHeader("仓库名称", Format = "", Width = 25, IsBold = true)]
    public string? WarehouseName { get; set; }
    
    /// <summary>
    /// 关联单号
    /// </summary>
    [ImporterHeader(Name = "关联单号")]
    [ExporterHeader("关联单号", Format = "", Width = 25, IsBold = true)]
    public string? RelatedCode { get; set; }
    
    /// <summary>
    /// 入库货品
    /// </summary>
    [ImporterHeader(Name = "入库货品")]
    [ExporterHeader("入库货品", Format = "", Width = 25, IsBold = true)]
    public string? GoodsName { get; set; }
    
    /// <summary>
    /// 经办人
    /// </summary>
    [ImporterHeader(Name = "经办人")]
    [ExporterHeader("经办人", Format = "", Width = 25, IsBold = true)]
    public string? AgentName { get; set; }
    
    /// <summary>
    /// 入库数量
    /// </summary>
    [ImporterHeader(Name = "*入库数量")]
    [ExporterHeader("*入库数量", Format = "", Width = 25, IsBold = true)]
    public int? InQuantity { get; set; }
    
    /// <summary>
    /// 入库金额
    /// </summary>
    [ImporterHeader(Name = "入库金额")]
    [ExporterHeader("入库金额", Format = "", Width = 25, IsBold = true)]
    public decimal? WarehouseAmount { get; set; }
    
    /// <summary>
    /// 库位ID
    /// </summary>
    [ImporterHeader(Name = "库位ID")]
    [ExporterHeader("库位ID", Format = "", Width = 25, IsBold = true)]
    public long? WarePlaceId { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [ImporterHeader(Name = "备注")]
    [ExporterHeader("备注", Format = "", Width = 25, IsBold = true)]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 软删除时间
    /// </summary>
    [ImporterHeader(Name = "软删除时间")]
    [ExporterHeader("软删除时间", Format = "", Width = 25, IsBold = true)]
    public DateTime? DeleteTime { get; set; }
    
}
